<!--
	作者：leeeeyx@hotmail.com
	时间：2017-09-27
	描述：生产业绩报表
-->
<style>
	.btn-primary:focus, .btn-primary.focus {
	    color: #fff;
	    background-color: #3c8dbc;
	    border-color: #367fa9;
	}
	.caret {
    margin-left: 0px !important;
	}
</style>
<style>
        	/*td,th{
				text-align: center;
			}
			th{
			   cursor: pointer;
			}*/
    		body{
    			font-family: "微软雅黑";
    		}
    		.table>thead>tr>th, .table>tbody>tr>th, .table>tfoot>tr>th, .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td {
			    border: 1px solid #d2d2d2;
			}
    		.go{
    			width: 50px;
            	height: 35px;
            	line-height: normal;
            	background-color: #ddd; 
			    border: none;
			    color: #000000;
			    text-align: center;
			    text-decoration: none;
			    display: inline-block;
    		}
    		.page{
    			width: 35px;
            	height: 35px;
            	line-height: normal;
            	background-color: #ddd; 
			    border: none;
			    color: #000000;
			    text-align: center;
			    text-decoration: none;
			    display: inline-block;
    		}
    		.navNum{
    			padding: 5px;
    			height: 35px;
			    line-height: 22px;
    		}
    		.navbar-nav li{
    			padding: 0px 5px 0px 5px;
    		}
        </style>
        <style >
        	.print{display:none;}
        </style>

		<style media="print">
			.print{display:none}
		</style>
        <style type="text/css" media="print"> 
		    .noprint{display:none;} 
		</style>
<meta charset="UTF-8">
<div class="content-wrapper" style="min-height: 901px;">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1 style="text-align:center">
        	生产业绩
      </h1>
    </section>

    <!-- Main content -->
    <section class="content">
      	<div class="row">
	        <div class="col-md-12">
		        <div class="box">
			        <div class="box-header noprint">
				        <div class="col-md-12" style="padding-bottom: 15px;">
							<button type="button" class="btn btn-primary coi" ng-click="chefOrItem(0,$event)">按厨师</button>
							<button type="button" class="btn coi" ng-click="chefOrItem(1,$event)">按菜品</button>
				        </div>
				        <!--<div class="col-md-1" style="padding-bottom: 15px;">
							<button class="btn pull-right" ng-click="download('tb_canteenReport','食堂终端收银日报')"><i class="fa fa-cloud-download"></i>&nbsp;&nbsp;导出</button>
				        </div>-->
				        
				        <div class='col-md-3'>
							<input type="text" class="form-control" id="datepicker" ng-model="searchDate">
						</div>
				        <!--
                        	作者：leeeeyx@hotmail.com
                        	时间：2017-09-27
                        	描述：功能按钮组 按厨师
                        -->
						<span ng-if="code == 0">
					        <div class="col-md-2 btn-group">
							 	<select class="btn btn-default" style="width: 100%;" ng-options="c.user_id as c.real_name for c in chefs" ng-model="searchByChef.id">
							 		<option value="">全部厨师</option>
							 	</select>
							</div>
							
					        <!--<div class="col-md-1">
							 	<button class="btn btn-default" ng-click="searchProductByChef();">查询</button>
							</div>-->
					       
						</span>
						<!--
                        	作者：leeeeyx@hotmail.com
                        	时间：2017-09-27
                        	描述：按菜品
                        -->
						<span ng-if="code == 1">
					        <div class="col-md-2 btn-group" style="padding-left: 0px;">
							 	<select class="btn btn-default" style="width: 100%;" ng-options="w.window_id as w.name for w in windows" ng-model="searchByItem.window" ng-change="getCinW()">
							 		<option value="">全部档口</option>
							 	</select>
							</div>
							<div class="col-md-2 btn-group" style="padding-left: 0px;">
							 	<select class="btn btn-default" style="width: 100%;" ng-options="c.user_id as c.real_name for c in chefs" ng-model="searchByItem.chef">
							 		<option value="">全部厨师</option>
							 	</select>
							</div>
							<div class="col-md-2 btn-group" style="padding-left: 0px;">
							 	<select class="btn btn-default" style="width: 100%;" ng-options="category.category_id as category.name for category in categorys" ng-model="searchByItem.category">
							 		<option value="">全部类别</option>
							 	</select>
							</div>
							<div class="col-md-1" style="padding: 0px;">
							 	<input class="form-control" placeholder="输入菜品名" ng-model="search.itemName"/>
							</div>
							<!--<div class="col-md-1">
							 	<button class="btn btn-default" ng-click="searchProductByItem();">查询</button>
							</div>-->
					    </span>
					    <!--
                        	作者：leeeeyx@hotmail.com
                        	时间：2017-09-27
                        	描述：通用---导出打印等
                        -->
					    <div class="pull-right btn-group">
					    	
							 	<button class="btn btn-default" ng-click="searchAll();">查询</button>
							
						 	<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
					      		<i class="glyphicon glyphicon-save icon-th"></i> 
					      		<span class="caret"></span>
					      	</button>
					      	<ul class="dropdown-menu" style="padding: 10px 20px 0px 20px;left: auto;right:0;min-width: 150px;">
						        <li style="padding-bottom: 10px;cursor: pointer;" ng-click="outPut()"><i class="glyphicon glyphicon-export icon-th pull-left"></i>&nbsp;导出Excel</li>
						        <li style="padding-bottom: 10px;cursor: pointer;" ng-click="outPrint()" ><i class="fa fa-print icon-th pull-left" style="font-size: 16px;"></i>&nbsp;打印</li>
					      	</ul>
						</div>
			        </div>
		            <div class="box-body table-responsive no-padding" >
		            	<div class="box" style="border: 0px;margin-bottom: 0px;">
					        <div class="box-body no-padding" style="min-height: 407px;" ng-if="code == 0">
					         	<table class="table table-striped noprint" show-filter="true" id="byChef">
								    <thead>
								    	<tr>
								    		<th style="width: 50px;">序号</th>
								    		<th ng-if="colName">姓名   </th>
									    	<th ng-if="colAge"  ng-click="sortBy('sale_number')">
									    		销售量
									    		<i class="fa fa-sort      pull-right" ng-if=" desc == undefined || sort != 'sale_number'"></i>
									    		<i class="fa fa-sort-asc  pull-right" ng-if="!desc && sort =='sale_number'"></i>
									    		<i class="fa fa-sort-desc pull-right" ng-if=" desc && sort =='sale_number'"></i>
									    	</th>
									    	<th ng-if="colSex"  ng-click="sortBy('sale_money')">
									    		销售额
									    		<i class="fa fa-sort      pull-right" ng-if=" desc == undefined || sort != 'sale_money'"></i>
									    		<i class="fa fa-sort-asc  pull-right" ng-if="!desc && sort =='sale_money'"></i>
									    		<i class="fa fa-sort-desc pull-right" ng-if=" desc && sort =='sale_money'"></i>
									    	</th>
									    	<th ng-if="colId" >参考毛利</th>
								    	</tr>
								    	
								    </thead>
								    <tbody>
								    	
									    <tr ng-repeat="user in items |  orderBy | filter : query " repeat-finish>
									    	<td>
									    		{{$index+1+selPage*pageSize-pageSize}}
									    	</td>
									        <td title="厨师姓名" ng-if="colName">
									            {{user.chef_real_name}}
									        </td>
									        <td title="销售量" ng-if="colAge">
									            {{user.sale_number}}
									        </td>
									        <td title="销售额" ng-if="colSex">
									            {{user.sale_money}}
									        </td>
									        <td title="参考毛利"   ng-if="colId">
									            {{user.profit}}
									        </td>
									    </tr>
								    </tbody>
				
								</table>
								<table class="table table-striped print" name="forPrint" id="bychefprint">
								    <tbody>
								    	<tr>
								    		<td>序号</td>
								    		<td>姓名</td>
								    		<td>销售量</td>
								    		<td>销售额</td>
								    		<td>参考利润</td>
								    	</tr>
									    <tr ng-repeat="user in simpleList">
									    	<td>
									    		{{$index+1+selPage*pageSize-pageSize}}
									    	</td>
									        <td title="厨师姓名" ng-if="colName">
									            {{user.chef_real_name}}
									        </td>
									        <td title="销售量" ng-if="colAge">
									            {{user.sale_number}}
									        </td>
									        <td title="销售额" ng-if="colSex">
									            {{user.sale_money}}
									        </td>
									        <td title="参考毛利"   ng-if="colId">
									            {{user.profit}}
									        </td>
									    </tr>
								    </tbody>
								</table>
								<!-- 导出excel -->
								<table class="table table-hover download" id="bychefdown">
					                <tbody>
						                <tr>
						                  	<td>序号</td>
								    		<td>姓名</td>
								    		<td>销售量</td>
								    		<td>销售额</td>
								    		<td>参考毛利</td>
						                </tr>
						                <tr ng-repeat="user in simpleList">
									    	<td>
									    		{{$index+1+selPage*pageSize-pageSize}}
									    	</td>
									        <td title="厨师姓名" ng-if="colName">
									            {{user.chef_real_name}}
									        </td>
									        <td title="销售量" ng-if="colAge">
									            {{user.sale_number}}
									        </td>
									        <td title="销售额" ng-if="colSex">
									            {{user.sale_money}}
									        </td>
									        <td title="参考毛利"   ng-if="colId">
									            {{user.profit}}
									        </td>
									    </tr>
					               	</tbody>
				            	</table> 
					        </div>
					        <!-- /.box-body  code==0-->
					        <!-- code == 1-->
					        <div class="box-body no-padding" style="min-height: 407px;" ng-if="code == 1">
					         	<table class="table table-striped noprint" show-filter="true" id="byItem">
								    <thead>
								    	<tr>
								    		<th style="width: 50px;">序号</th>
								    		<th ng-if="colName" style="width: 100px;">厨师姓名</th>
								    		<th>菜品名称</th>
								    		<th>档口名称</th>
									    	<th ng-if="colAge"  ng-click="sortBy('sale_number')">
									    		销售量
									    		<i class="fa fa-sort      pull-right" ng-if=" desc == undefined || sort != 'sale_number'"></i>
									    		<i class="fa fa-sort-asc  pull-right" ng-if="!desc && sort =='sale_number'"></i>
									    		<i class="fa fa-sort-desc pull-right" ng-if=" desc && sort =='sale_number'"></i>
									    	</th>
									    	<th ng-if="colSex"  ng-click="sortBy('sale_money')">
									    		销售额
									    		<i class="fa fa-sort      pull-right" ng-if=" desc == undefined || sort != 'sale_money'"></i>
									    		<i class="fa fa-sort-asc  pull-right" ng-if="!desc && sort =='sale_money'"></i>
									    		<i class="fa fa-sort-desc pull-right" ng-if=" desc && sort =='sale_money'"></i>
									    	</th>
								    	</tr>
								    	
								    </thead>
								    <tbody>
								    	
									    <tr ng-repeat="user in items |  orderBy | filter : query " repeat-finish>
									    	<td>
									    		{{$index+1+selPage*pageSize-pageSize}}
									    	</td>
									        <td title="厨师姓名" ng-if="colName" >
									            {{user.chef_real_name}}
									        </td>
									        <td title="菜品名称">
									            {{user.item_name}}
									        </td>
									        <td title="档口名称">
									            {{user.window_name}}
									        </td>
									        <td title="销售量" ng-if="colAge">
									            {{user.sale_number}}
									        </td>
									        <td title="销售额" ng-if="colSex">
									            {{user.sale_money}}
									        </td>
									    </tr>
								    </tbody>
				
								</table>
								<table class="table table-striped print" name="forPrint" id="byitemprint">
								    <thead>
								    	<tr>
								    		<th style="width: 50px;">序号</th>
								    		<th ng-if="colName" style="width: 100px;">厨师姓名</th>
								    		<th>菜品名称</th>
								    		<th>档口名称</th>
									    	<th ng-if="colAge"  ng-click="sortBy('sale_number')">
									    		销售量
									    		<i class="fa fa-sort      pull-right" ng-if=" desc == undefined || sort != 'sale_number'"></i>
									    		<i class="fa fa-sort-asc  pull-right" ng-if="!desc && sort =='sale_number'"></i>
									    		<i class="fa fa-sort-desc pull-right" ng-if=" desc && sort =='sale_number'"></i>
									    	</th>
									    	<th ng-if="colSex"  ng-click="sortBy('sale_money')">
									    		销售额
									    		<i class="fa fa-sort      pull-right" ng-if=" desc == undefined || sort != 'sale_money'"></i>
									    		<i class="fa fa-sort-asc  pull-right" ng-if="!desc && sort =='sale_money'"></i>
									    		<i class="fa fa-sort-desc pull-right" ng-if=" desc && sort =='sale_money'"></i>
									    	</th>
								    	</tr>
								    	
								    </thead>
								    <tbody>
								    	
									    <tr ng-repeat="user in items |  orderBy | filter : query " repeat-finish>
									    	<td>
									    		{{$index+1+selPage*pageSize-pageSize}}
									    	</td>
									        <td title="厨师姓名" ng-if="colName" >
									            {{user.chef_real_name}}
									        </td>
									        <td title="菜品名称">
									            {{user.item_name}}
									        </td>
									        <td title="档口名称">
									            {{user.window_name}}
									        </td>
									        <td title="销售量" ng-if="colAge">
									            {{user.sale_number}}
									        </td>
									        <td title="销售额" ng-if="colSex">
									            {{user.sale_money}}
									        </td>
									    </tr>
								    </tbody>
								</table>
								<!-- 导出excel -->
								
								<table class="table table-hover download" id="byitemdown">
					                <tbody>
						                <tr>
						                  	<td>序号</td>
								    		<td>厨师姓名</td>
								    		<td>菜品名称</td>
								    		<td>档口名称</td>
								    		<td>销售量</td>
								    		<td>销售额</td>
						                </tr>
						                <tr ng-repeat="user in simpleList">
									    	<td>
									    		{{$index+1+selPage*pageSize-pageSize}}
									    	</td>
									        <td>
									            {{user.chef_real_name}}
									        </td>
									        <td>
									            {{user.item_name}}
									        </td>
									        <td>
									            {{user.window_name}}
									        </td>
									        <td>
									            {{user.sale_number}}
									        </td>
									        <td>
									            {{user.sale_money}}
									        </td>
									    </tr>
					               	</tbody>
				            	</table>
					        </div>
					        <div class="box-footer noprint">
				                <ul class="nav navbar-nav pull-right">
				                	<li>
				                		每页
				                		<select name="example1_length" aria-controls="example1" class=" input-sm" ng-change="change(initial)" ng-model="initial" style="border-radius: 0px;height: 35px;"> 
				            				<option value="10">10</option> 
				            				<option value="25">25</option>
				            				<option value="50">50</option>
				            				<option value="100">100</option>
				            		    </select>
				                	</li>
				                	<li>
				                		<input ng-model="page" style="width: 35px;height: 35px;" type="number">
										<input type="button" style="" value="跳转" ng-click="selectPage(page)" class="go">
				                	</li>
				                	<li>
				                		<div class="navNum">
				                			{{selPage}}/{{pages}}页
				                		</div>
				                		
				                	</li>
				                	<li>
				                		<button type="button" style="" ng-click="Previous()" class="page"><i class="glyphicon glyphicon-chevron-left"></i></button>
				                	</li>
				                	<li>
				                		<button type="button" style="" ng-click="Next()" class="page"><i class="glyphicon glyphicon-chevron-right"></i></button>
				                	</li>
				                </ul>		
					        </div>
				
					  	</div> 
		           </div>
		        </div>
	          	<!-- /.box -->
	        </div>
      	</div>
    </section>
    <!-- /.content -->
  </div>
